<html><head>
<style>
.pkttable td { width: 60px; text-align: center;}
</style>
</head>
<body>
<p>The pibind service is a simple naming service to find
specific instrumentation in a local net.
</p>
<p> 
constraints:
<ul>
<li>each instrument shall have the pibind service running</li>
<li>instruments and requesting client must be in the same network segment</li>
<li>the 'common name' of the instrument must be known by the client</li>
<li>local firewall rules on the client machine must allow udp broadcasts</li>
</ul>

<p>An instrument is identified by its 'common name', these names  must be unique 
for each instrument in local the subnet. 
</p>

<p>The protocol is implemented by sending udp packages on port 888 and port 8888.
The dual port configuration was chosen to allow instrument drivers to run with 
non-root priviliges in unix-like environments.
</p>
<p>The client sends a 'whois' package via udp broadcast to the protocoll ports.
It then waits for an anwer on its own interface address. The client determins 
the ip address of the instrument over the 'remote address' tcp fields.   
</p>

generic package format:
<table border='1' class='pkttable'>
<tr><td>'p'</td><td>'i'</td><td>'b'</td><td>tp</td></tr>
<tr><td colspan='2'>version</td><td colspan='2'>payloadsize</td></tr>
<tr><td colspan='4'>payload</td></tr>
</table>

<p>A magic 'pib' marks the beginning of a package.
the 'version' field specifies the protocol version, it should be 0x100.
The 'tp' field specifies the package type.</p>


'populate' client request:
<table border='1' class='pkttable'>
<tr><td>'p'</td><td>'i'</td><td>'b'</td><td>'P'</td></tr>
<tr><td colspan='2'>version</td><td colspan='2'>0x00</td></tr>
</table>

<p> Each connected instrument should answer.</p>

'whois' client request:
<table border='1' class='pkttable'>
<tr><td>'p'</td><td>'i'</td><td>'b'</td><td>'W'</td></tr>
<tr><td colspan='2'>version</td><td colspan='2'>len</td></tr>
<tr><td colspan='4'>requested name</td></tr>
</table>

<p>The instrument matching 'name' shouldanswer.</p>

instruments 'response' package:
<table border='1' class='pkttable'>
<tr><td>'p'</td><td>'i'</td><td>'b'</td><td>'R'</td></tr>
<tr><td colspan='2'>version</td><td colspan='2'>len</td></tr>
<tr><td colspan='4'>requested name</td></tr>
</table>

  



</body>
</html>

 
